package dmp.topk;

import java.io.IOException;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

public class CountReducer  extends Reducer<Text, LongWritable, Text, LongWritable>{
	private LongWritable resultValue=new LongWritable();
	@Override
	protected void reduce(Text key, Iterable<LongWritable> values, Context context) throws IOException, InterruptedException {
		int count=0;
		for (LongWritable value : values) {
			count++;
		}
		resultValue.set(count);
		context.write(key, resultValue);
	}
}
